package negocio;

import java.util.ArrayList;

import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import beans.CafeteriaVO;
import beans.PlatoVO;

@Entity
@PrimaryKeyJoinColumn(name="id_cafeteria")
@Table(name="cafeteria")
public class Cafeteria extends Area
{

	private static final long serialVersionUID = 1L;
	
	public Cafeteria(){
		
	}
	
	public Cafeteria(Deposito depositoLocal){
		super("Cafeteria", depositoLocal);
	}
	
	public CafeteriaVO getVO()
	{
		CafeteriaVO cafeteriaVO = new CafeteriaVO();
		cafeteriaVO.setDeposito(getDepositoArea().getVO());
		
		ArrayList<PlatoVO> platosVOs = new ArrayList<PlatoVO>();
		for(Plato p : this.getPlatosPendientes())
		{
			PlatoVO platoVO=p.getVO();
			platosVOs.add(platoVO);
		}
		cafeteriaVO.setPlatosPendientes(platosVOs);
		
		return cafeteriaVO;
	}
	
	@Override
	public String toString() {
		return "Cafeteria []";
	}
}
